package com.itheima.tliaswebmanagement.controller;

import com.itheima.tliaswebmanagement.pojo.common.Result;
import com.itheima.tliaswebmanagement.pojo.vo.JobOptionVO;
import com.itheima.tliaswebmanagement.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Description ReportController
 * @Author ziguan ling
 * @Date 2025--01--09
 */
@Slf4j
@RestController
@RequestMapping("/report")

public class ReportController {
    @Autowired
    ReportService reportService;

    @GetMapping("/empJobData")
    public Result empJobData() {
        log.info("员工人数职位统计");
        JobOptionVO jobOptionVO = reportService.empJobData();
        return Result.success(jobOptionVO);
    }

    @GetMapping("/empGenderData")
    public Result empGenderData(){
        log.info("员工性别人数统计");
        List<Map> reportResult_empGender = reportService.empGenderData_s();
        return Result.success(reportResult_empGender);
    }

    @GetMapping("/studentDegreeData")
    public Result studentDegreeData(){
        log.info("学员学历统计");
        List<Map> reportResult_studentDegree = reportService.studentDegreeData_s();
        return Result.success(reportResult_studentDegree);
    }

}
